import React from "react";

const MERCHANT_SERVICE_URL = "/#/pay/merchantService";
const ME_URL = "/#/pay/me";
class ServiceMenu extends React.Component {

    constructor(props) {
        super(props);
    }

    render() {
        let {selectedIndex} = this.props;
        let leftClassName = "";
        let rightClassName = "";
        if (selectedIndex == 1) {
            leftClassName = "curr";
        } else {
            rightClassName = "curr";
        }
        return (
            <div className="service-menu-container">
                <button className={leftClassName} onClick={this._visitUrl.bind(this, MERCHANT_SERVICE_URL)}>交易记录
                </button>
                <button className={rightClassName} onClick={this._visitUrl.bind(this, ME_URL)}>我</button>
            </div>
        );
    }

    _visitUrl(url) {
        window.location.href = url;
    }
}

export default  ServiceMenu;